<?php include("connection.php"); ?>
<?php 
$config_id=$_REQUEST['config_id'];
$query=mysql_query("SELECT * FROM configuration where idConfiguration='$config_id'");
$row=mysql_fetch_array($query);
//print_r($row);

function get_name($type,$code)
{
    switch($type)
    {
        case "1":
        $query1 = mysql_query("SELECT * from `airport_code` WHERE airport_code='$code' order by rank") ;
        $row1=mysql_fetch_array($query1);
        echo $row1['name'].' ('.$row1['airport_code'].')';
        break;
        case "2":
        $query1 = mysql_query("SELECT * from `states` WHERE state_code='$code'") ;
        $row1=mysql_fetch_array($query1);
        echo $row1['state_name'].' ('.$row1['state_code'].')';
        break;
        case "3":
        $query1 = mysql_query("SELECT * from `countries` WHERE country_code='$code'") ;
        $row1=mysql_fetch_array($query1);
        echo $row1['country_name'].' ('.$row1['country_code'].')';
        break;
        case "4":
        $query1 = mysql_query("SELECT * from `region` WHERE region_code='$code'") ;
        $row1=mysql_fetch_array($query1);
        echo $row1['region_name'].' ('.$row1['region_code'].')';
        break;
        

    }
    
}




?>


<style type="text/css">
<!--
body, td, th {
    font-family: segoe UI, tahoma, trebuchet MS, verdana;
    font-size: 12px;
    color: #000;
}
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
a:link {
    color: #03C;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #03C;
}
a:hover {
    text-decoration: none;
    color: #03C;
}
a:active {
    text-decoration: none;
    color: #03C;
}
.checkbox {
}
select{    font-family: segoe UI, tahoma, trebuchet MS, verdana;
    font-size: 12px;
    color: #000;}
input{    font-family: segoe UI, tahoma, trebuchet MS, verdana;
    font-size: 12px;
    color: #000; }
-->
</style>

<div align="center">
<form name="create_config" id="create_config" action="make_config.php">
<input type="text" style="display:none;" value="<?php echo $config_id;?>" id="config_id" name="config_id"/>
<input type="text" style="display:none;" value="<?php echo $row['dep_code']; ?>" id="dep_code" name="dep_code"/>
<input type="text" style="display:none;" value="<?php echo $row['arr_code']; ?>" id="ret_code" name="ret_code"/>
<table width="550" height="87" border="0" cellpadding="4" cellspacing="1">
  <tr>
    <td align="left"  valign="top" bgcolor="#F3F3F3"><strong>&raquo; Edit Configuration</strong></td>
</tr>
  <tr>
    <td width="364" align="left" bgcolor="#f8f8f8"><strong>&raquo; Departure </strong></td>
</tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8">
      
      
      
      Select Type-&gt;
      <input type="radio" name="dep_type" id="dep_arp" value="1" align="absmiddle" class="required" <?php if($row['dep_type']=='1'){ ?> checked="checked" <?php } ?>/>Aiport
      <input type="radio" name="dep_type" id="dep_sta" value="2" align="absmiddle" class="required" <?php if($row['dep_type']=='2'){ ?> checked="checked" <?php } ?>/>State
      <input type="radio" name="dep_type" id="dep_con" value="3" align="absmiddle" class="required" <?php if($row['dep_type']=='3'){ ?> checked="checked" <?php } ?>/>Country
      <input type="radio" name="dep_type" id="dep_reg" value="4" align="absmiddle" class="required" <?php if($row['dep_type']=='4'){ ?> checked="checked" <?php } ?>/>Region
      <input type="radio" name="dep_type" id="dep_all" value="5" align="absmiddle" class="required" checked="checked"<?php if($row['dep_type']=='5'){ echo 'checked="checked"'; } ?> />Any Where
    </td>
    </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8" id="dep_t">
    
    <input type="text" name="dep[]" id="dep" value="ALL" readonly="readonly" width="300" height="15" /></td>
    </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8"><strong>&raquo; Arrival</strong></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8">Select Type-&gt;
      <input type="radio" name="ret_type" id="ret_arp" value="1" align="absmiddle" class="required" <?php if($row['arr_type']=='1'){ ?> checked="checked" <?php } ?>/>
      Aiport
      <input type="radio" name="ret_type" id="ret_sta" value="2" align="absmiddle" class="required" <?php if($row['arr_type']=='2'){ ?> checked="checked" <?php } ?>/>
      State
      <input type="radio" name="ret_type" id="ret_con" value="3" align="absmiddle" class="required" <?php if($row['arr_type']=='3'){ ?> checked="checked" <?php } ?>/>
      Country
      <input type="radio" name="ret_type" id="ret_reg" value="4" align="absmiddle" class="required" <?php if($row['arr_type']=='4'){ ?> checked="checked" <?php } ?>/>
      Region
      <input type="radio" name="ret_type" id="ret_all" value="5" align="absmiddle" class="required" checked="checked" <?php if($row['arr_type']=='5'){ echo 'checked="checked"'; } ?> />Any Where
      </td>
  </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8" id="ret_t">
    <input type="text" name="ret[]" id="ret" value="ALL" readonly="readonly" width="300" height="15" />
    </td>
  </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8"><strong>&raquo; Status</strong></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8"><table width="19%" border="0" cellspacing="0" cellpadding="4">
      <tr>
        <td width="20"><input type="radio" name="status" id="radio15" value="1"  class="required" <?php if($row['status']=='1'){ ?> checked="checked" <?php } ?>  /></td>
        <td width="36">Active</td>
        <td width="20"><input type="radio" name="status" id="radio16" value="0"  class="required" <?php if($row['status']=='0'){ ?> checked="checked" <?php } ?>  /></td>
        <td width="42">Paused</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8"><p><strong>&raquo; Comment</strong></p></td>
</tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8"><label>
      <textarea name="comment" id="comment" cols="30" rows="3" ></textarea>
    </label></td>
</tr>
  <tr>
    <td align="center" bgcolor="#f8f8f8">
    


    
    
      <input type="submit" name="button"  value="Submit" style="background-color:#cf0104; color:#FFF; font-family:segoe Ui; font-size:13px; width:102px;" />
</td>
</tr>
</table>

</form>
</div>




